package com.lovo.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @title
 * @author: luo
 * @date: 2020/11/19 11:17
 */
@Entity
@Table(name = "t_factoryDetail")
@Data
@NoArgsConstructor
public class FactoryDetail implements Serializable {

    @Id
    @GenericGenerator(name = "hbincrement", strategy = "increment")
    @GeneratedValue(generator = "hbincrement")
    private Integer id;
    private String type;
    @Column(name = "pepole")
    private Integer people;
    @OneToOne(mappedBy = "factoryDetail")
    @JsonIgnore
    private FactoryDO factoryDO;

    @Override
    public String toString() {
        return "FactoryDetail{" +
                "id=" + id +
                ", type='" + type + '\'' +
                ", people=" + people +
                '}';
    }
}
